<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>教练员列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">

    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        tr td,
        tr th {
            text-align: center !important;
            border: none !important;
        }

        .layui-laydate-content tr td {
            border-bottom: none !important;
            border-top: none !important;
        }

        tr td {
            border-bottom: 1px solid #eee !important;
            border-top: 1px solid #eee !important;
        }

        .shaixuan .layui-col-md12 .layui-inline {
            margin: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-input-inline {
            width: 53%;
        }

        .rotate {

            transform-origin: center center;

            transform: rotate(180deg);

            -webkit-transform: rotate(180deg);

            -moz-transform: rotate(180deg);

            -ms-transform: rotate(180deg);

            -o-transform: rotate(180deg);

            transition: transform 0.2s;
            -moz-transition: -moz-transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -o-transition: -o-transform 0.2s;

            -ms-transition: -ms-transform 0.2s;

        }

        .rotate1 {

            transform-origin: center center;

            transform: rotate(0deg);
            -webkit-transform: rotate(0deg);

            -moz-transform: rotate(deg);

            -ms-transform: rotate(0deg);

            -o-transform: rotate(0deg);

            transition: transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -o-transition: -o-transform 0.2s;

            -ms-transition: -ms-transform 0.2s;

        }
    </style>
</head>

<body>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card" style="display: flex;justify-content: space-between;">
                    <div class="layui-card-body ">
                        <blockquote class="layui-elem-quote" style="border:0;font-size: 18px;color: #000;">教练员列表
                        </blockquote>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-card">
                    <!-- <div class="layui-card-header">数据统计</div> -->
                    <div class="layui-fluid">
                        <div class="layui-row layui-col-space15">
                            <div class="layui-col-md12">
                                <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                    <form class="layui-form" action="" style="width: 100%;">
                                        <div class="layui-inline layui-show-xs-block">
                                            <input id="name" class="layui-input" type="text" placeholder="请输入教练员姓名">
                                        </div>
                                        <div class="layui-inline layui-show-xs-block">
                                            <button class="layui-btn search" data-type="reload" lay-filter="add">搜索
                                            </button>
                                            <i style="position: relative;font-size: 18px;left: 15px;top: 5px;cursor: pointer;display: inline-block;"
                                                class="layui-icon layui-icon-down rotate1"></i>
                                        </div>
                                        <div class="layui-inline layui-show-xs-block" style="float: right">
                                            <blockquote style="cursor: pointer" class="layui-elem-quote"
                                                onclick="xadmin.open('导入','import_coach.html',600,400)"><i
                                                    class="iconfont">&#xe635;</i>导入
                                            </blockquote>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12 shaixuan" style="display: none;">
                <div class="layui-card">
                    <!-- <div class="layui-card-header">数据统计</div> -->
                    <div class="layui-fluid">
                        <div class="layui-row layui-col-space15">
                            <div class="layui-col-md12">
                                <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                    <form class="layui-form" action="" style="width: 100%;">
                                        <div class="layui-form-item layui-col-md12">
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">起始注册时间：</label>
                                                <div class="layui-input-inline">
                                                    <input id="beginTime" name="beginTime" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">结束注册时间：</label>
                                                <div class="layui-input-inline">
                                                    <input id="endTime" name="endTime" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">年龄：</label>
                                                <div class="layui-input-inline">
                                                    <input id="age" name="age" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">教练员等级：</label>
                                                <div class="layui-input-inline">
                                                    <select id="coachLevel" name="coachLevel" lay-verify="required">
                                                        <option value="">请选择</option>
                                                        <option value="1">D级</option>
                                                        <option value="2">C级</option>
                                                        <option value="3">B级</option>
                                                        <option value="4">A级</option>
                                                        <option value="5">职业级（PRO）</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">所在球队：</label>
                                                <div class="layui-input-inline">
                                                    <select id="associationId" name="associationId"
                                                        lay-filter="associationId">
                                                        <option value="">全部</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">民族：</label>
                                                <div class="layui-input-inline">
                                                    <select id="nation" name="nation" lay-verify="required" lay-search>
                                                        <option value="">请选择</option>
                                                        <option value="汉族">汉族</option>
                                                        <option value="阿昌族">阿昌族</option>
                                                        <option value="白族">白族</option>
                                                        <option value="保安族">保安族</option>
                                                        <option value="布朗族">布朗族</option>
                                                        <option value="布依族">布依族</option>
                                                        <option value="朝鲜族">朝鲜族</option>
                                                        <option value="达斡尔族">达斡尔族</option>
                                                        <option value="傣族">傣族</option>
                                                        <option value="德昂族">德昂族</option>
                                                        <option value="侗族">侗族</option>
                                                        <option value="东乡族">东乡族</option>
                                                        <option value="独龙族">独龙族</option>
                                                        <option value="鄂伦春族">鄂伦春族</option>
                                                        <option value="俄罗斯族">俄罗斯族</option>
                                                        <option value="鄂温克族">鄂温克族</option>
                                                        <option value="高山族">高山族</option>
                                                        <option value="仡佬族">仡佬族</option>
                                                        <option value="哈尼族">哈尼族</option>
                                                        <option value="哈萨克族">哈萨克族</option>
                                                        <option value="赫哲族">赫哲族</option>
                                                        <option value="回族">回族</option>
                                                        <option value="基诺族">基诺族</option>
                                                        <option value="京族">京族</option>
                                                        <option value="景颇族">景颇族</option>
                                                        <option value="柯尔克孜族">柯尔克孜族</option>
                                                        <option value="拉祜族">拉祜族</option>
                                                        <option value="黎族">黎族</option>
                                                        <option value="傈僳族">傈僳族</option>
                                                        <option value="珞巴族">珞巴族</option>
                                                        <option value="满族">满族</option>
                                                        <option value="毛南族">毛南族</option>
                                                        <option value="门巴族">门巴族</option>
                                                        <option value="蒙古族">蒙古族</option>
                                                        <option value="苗族">苗族</option>
                                                        <option value="仫佬族">仫佬族</option>
                                                        <option value="纳西族">纳西族</option>
                                                        <option value="怒族">怒族</option>
                                                        <option value="普米族">普米族</option>
                                                        <option value="羌族">羌族</option>
                                                        <option value="撒拉族">撒拉族</option>
                                                        <option value="畲族">畲族</option>
                                                        <option value="水族">水族</option>
                                                        <option value="塔吉克族">塔吉克族</option>
                                                        <option value="塔塔尔族">塔塔尔族</option>
                                                        <option value="土族">土族</option>
                                                        <option value="土家族">土家族</option>
                                                        <option value="佤族">佤族</option>
                                                        <option value="锡伯族">锡伯族</option>
                                                        <option value="乌兹别克族">乌兹别克族</option>
                                                        <option value="瑶族">瑶族</option>
                                                        <option value="彝族">彝族</option>
                                                        <option value="裕固族">裕固族</option>
                                                        <option value="维吾尔族">维吾尔族</option>
                                                        <option value="壮族">壮族</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">市级：</label>
                                                <div class="layui-input-inline">
                                                    <select id="city" name="city" lay-verify="required">
                                                        <option value="">全部</option>

                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">是否有合同：</label>
                                                <div class="layui-input-inline">
                                                    <select id="isContract" name="isContract" lay-verify="required">
                                                        <option value="">全部</option>
                                                        <option value="1">是</option>
                                                        <option value="2">否</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">政治面貌：</label>
                                                <div class="layui-input-inline">
                                                    <select id="politicCountenance" name="politicCountenance"
                                                        lay-filter="politicCountenance">
                                                        <option value="">全部</option>
                                                        <option value="1">党员</option>
                                                        <option value="2">共青团员</option>
                                                        <option value="3">群众</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">性别：</label>
                                                <div class="layui-input-inline">
                                                    <select id="sex" name="sex" lay-filter="sex">
                                                        <option value="">全部</option>
                                                        <option value="1">男</option>
                                                        <option value="2">女</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">年份：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="year" id="year" lay-verify="date"
                                                        autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">证件类型：</label>
                                                <div class="layui-input-inline">
                                                    <select id="documentType" lay-filter="documentType"
                                                        name="documentType" lay-verify="required">
                                                        <option value="">全部</option>
                                                        <option value="1">身份证</option>
                                                        <option value="2">护照</option>
                                                        <option value="3">户口本</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">身高：</label>
                                                <div class="layui-input-inline">
                                                    <input id="height" type="text" name="height" lay-verify="required"
                                                        autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">体重：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="weight" name="weight" lay-verify="required"
                                                        autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">血型：</label>
                                                <div class="layui-input-inline">
                                                    <select id="bloodType" name="bloodType" lay-filter="bloodType"
                                                        lay-verify="required">
                                                        <option value="">全部</option>
                                                        <option value="1">A</option>
                                                        <option value="2">B</option>
                                                        <option value="3">AB</option>
                                                        <option value="4">O</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md3">
                                                <label class="layui-form-label">出生日期：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="birthDay" id="birthDay" lay-verify="date"
                                                        autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-card-body layui-table-body layui-table-main">

                <!-- 表格部分开始 -->
                <table id="application_table" lay-filter="test" lay-data="{id: 'testReload'}"></table>
                <script type="text/html" id="barDemo">
                    <!--<a lay-event="detail" class="btn_a layui-btn layui-btn-primary layui-btn-xs">查看</a>-->
                <a lay-event="watch" class="btn_a layui-btn layui-btn-xs">查看</a>
                <a lay-event="edit" class="btn_a layui-btn layui-btn-xs">修改</a>
                <a lay-event="del" class="btn_a layui-btn layui-btn-danger layui-btn-xs">锁定</a>
                </script>
                <!-- 表格结束 -->
            </div>
        </div>
    </div>
    </div>
</body>

</html>
<script>
    layui.use(['table', 'laydate'], function () {
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;

        var cityList = ["济南市", "青岛市", "聊城市", "德州市", "东营市", "淄博市", "潍坊市", "烟台市", "威海市", "日照市", "临沂市", "枣庄市",
            "济宁市", "泰安市", "滨州市", "菏泽市"
        ]
        for (var i = 0; i < cityList.length; i++) {
            $("#city").append(
                "<option value=\"" + cityList[i] + "\">" + cityList[i] + "</option>"
            )
        }
        //获取协会列表
        $.ajax({
            url: getAssociationList,
            type: "POST",
            // 设置的是请求参数
            data: {},
            // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
            dataType: 'json',
            success: function (res) {
                for (var i = 0; i < res.associationList.length; i++) {
                    $("#associationId").append(
                        "<option value=\"" + res.associationList[i].id + "\">" + res
                        .associationList[i].name + "</option>"
                    )
                }
                form.render('select'); //刷新select选择框渲染
            }
        })

        var index = layer.load(1); //添加laoding,0-2两种方式
        var date1 = laydate.render({
            elem: '#beginTime',
            type: 'date'
        })
        var date2 = laydate.render({
            elem: '#endTime',
            type: 'date'
        })
        laydate.render({ // 初始化时间选择器
            elem: '#establishmentData',
        });
        laydate.render({ // 初始化时间选择器
            elem: '#year',
            type: 'year'
        });
        laydate.render({ // 初始化时间选择器
            elem: '#birthDay',
        });
        form.on('select(s_province)', function (data) {
            change(1);
            form.render('select');
        });
        form.on('select(s_city)', function (data) {
            change(2);
            form.render('select');
        });
        //第一个实例


        table.render({

            elem: '#application_table', //指定原始表格元素选择器（推荐id选择器）
            // height: 600,
            toolbar: true,
            defaultToolbar: ['exports', {
                title: '提示' //标题
                    ,
                layEvent: 'LAYTABLE_TIPS' //事件名，用于 toolbar 事件中使用
                    ,
                icon: 'layui-icon-tips' //图标类名
            }],
            width: "100%",
            // 附加参数，post token
            // where: { 'token': token },
            loading: true,
            method: 'get',
            url: getTrainerList, //数据接口
            page: true, //开启分页
            // toolbar: 'default', //开启工具栏，此处显示默认图标
            limit: 10,
            limits: [10, 20, 30, 50, 100, 500, 1000, 5000, 10000],
            cols: [
                [ //表头
                    // {
                    //     type: 'checkbox',
                    //     fixed: 'left'
                    // },
                    {
                        field: 'id',
                        title: '用户ID',
                        width: 70
                    },
                    {
                        field: 'headPhoto',
                        title: '头像',
                        width: 150,
                        templet: function (d) {
                            if (d.headPhoto == null) {
                                return "-"
                            } else {
                                return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                    d.headPhoto + "'></div>'"
                            }
                        }
                    },
                    {
                        field: 'name',
                        title: '姓名',
                        width: 70
                    },
                    {
                        field: 'sex',
                        title: '性别',
                        width: 70,
                        templet: function (d) {
                            if (d.sex == "1") {
                                return "男"
                            } else if (d.sex == "2") {
                                return "女"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'bloodType',
                        title: '血型',
                        width: 70,
                        templet: function (d) {
                            if (d.bloodType == "1") {
                                return "A"
                            } else if (d.bloodType == "2") {
                                return "B"
                            } else if (d.bloodType == "3") {
                                return "AB"
                            } else if (d.bloodType == "4") {
                                return "O"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'nation',
                        title: '民族',
                        width: 70
                    },
                    {
                        field: 'year',
                        title: '年份',
                        width: 70
                    },
                    {
                        field: 'city',
                        title: '市级',
                        width: 70
                    }, {
                        field: 'associationName',
                        title: '所属协会',
                        width: 100
                    },
                    {
                        field: 'medicalReportUrl',
                        title: '相关资质照片',
                        width: 150,
                        templet: function (d) {
                            if (d.medicalReportUrl == null) {
                                return "-"
                            } else {
                                return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                    d.medicalReportUrl + "'></div>'"
                            }
                        }
                    },
                    {
                        field: 'addTime',
                        title: '创建时间',
                        width: 150,
                        templet: function (d) {
                            if (d.addTime == null) {
                                return "-"
                            } else {
                                return d.addTime
                            }
                        }
                    },
                    {
                        field: 'ishidden',
                        title: '是否锁定',
                        width: 150,
                        templet: function (d) {
                            if (d.ishidden == "0") {
                                return "正常"
                            } else if (d.bloodType == "1") {
                                return "锁定"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        fixed: 'right',
                        title: "操作",
                        width: 250,
                        align: 'center',
                        toolbar: '#barDemo'
                    }
                ]
            ],
            id: 'testReload',
            done: function (res) {
                if (res.msg == "2") {
                    parent.window.location.href = getRequestPrefix() + "/footBallAdmin/login.html"
                }
                layer.close(index)
            }
        });
        //下拉框
        $(".layui-icon.layui-icon-down").on("click", function () {
            $(".shaixuan").stop(true, false);
            if ($(this).hasClass("rotate") && !$(this).hasClass("rotate1")) {
                $(this).removeClass("rotate").addClass("rotate1");
                $(".shaixuan").slideUp()
            } else if ($(this).hasClass("rotate1") && !$(this).hasClass("rotate")) {
                $(this).removeClass("rotate1").addClass("rotate");
                $(".shaixuan").slideDown()
            }
        })
        // 监听select，搜索
        form.on('select(sex)', function (data) {
            console.log(data.value); //得到被选中的值
            table.reload('testReload', {
                page: {
                    curr: 1 //重新从第 1 页开始
                },
                where: {
                    sex: data.value,
                }
            }, 'data');
        });


        //头部输入框筛选功能
        var active = {

            reload: function () {
                var name = $('#name').val();
                var year = $('#year').val();
                var associationId = $('#associationId').val();
                var sex = $('#sex').val();
                var documentType = $('#documentType').val();
                var height = $('#height').val();
                var weight = $('#weight').val();
                var city = $('#city').val();
                var nation = $('#nation').val();
                var birthDay = $('#birthDay').val();
                var bloodType = $('#bloodType').val();
                var politicCountenance = $('#politicCountenance').val();
                var beginTime = $('#beginTime').val();
                var endTime = $('#endTime').val();
                var age = $('#age').val();
                var coachLevel = $('#coachLevel').val();
                var associationId = $('#associationId').val();
                var isContract = $('#isContract').val();

                // 执行重载（重新加载数据表格）
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    },
                    where: {
                        name: name,
                        year: year,
                        associationId: associationId,
                        sex: sex,
                        documentType: documentType,
                        height: height,
                        politicCountenance: politicCountenance,
                        weight: weight,
                        city: city,
                        nation: nation,
                        birthDay: birthDay,
                        bloodType: bloodType,
                        startAddTime: beginTime,
                        endAddTime: endTime,
                        age: age,
                        coachLevel: coachLevel,
                        associationId: associationId,
                        isContract: isContract
                    }
                }, 'data');
            }
        };


        //给查询添加点击事件
        $('.search').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
            //一定要阻止表单的默认行为（刷新）
            return false
        });


        //监听点击的按钮，获取行信息
        table.on('tool(test)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
            //获得当前行数据
            var $ = layui.$
            var data = obj.data,
                layEvent = obj.event; //获得 lay-event 对应的值

            if (layEvent === "edit") {
                // layer.msg('审批');
                layer.open({
                    content: "edit_trainer_info.html",
                    type: 2, //打开的窗口的类型
                    area: ["100%", "100%"],
                    title: "修改信息",
                    // btn: ['确认', '取消'],//开启显示按钮功能
                    // btnAlign: 'c',//居中显示按钮
                    // shade:true,
                    shadeClose: true,
                    success: function (layero, index) {

                        console.log(data) //获取点击行的数据,获取打开的iframe
                        var body = layer.getChildFrame('body', index);
                        var iframeWin = window[layero.find('iframe')[0]['name']];
                        body.find("#name").val(data.name);
                        body.find("#name").attr("data-id", data.id);
                        body.find("#sex").val(data.sex);
                        body.find("#documentType").val(data.documentType);
                        body.find("#documentNumber").val(data.documentNumber);
                        body.find("#height").val(data.height);
                        body.find("#weight").val(data.weight);
                        body.find("#bloodType").val(data.bloodType);
                        body.find("#nationality").val(data.nationality);
                        body.find("#nation").val(data.nation);
                        body.find("#associationId").attr("data-val", data.associationId);
                        body.find("#year").val(data.year);
                        body.find("#birthDay").val(data.birthDay);
                        body.find("#birthAddress").val(data.birthAddress);
                        body.find("#politicCountenance").val(data.politicCountenance);
                        body.find('#coachLevel').val(data.coachLevel)
                        if (data.isContract == "1") {
                            body.find("input[name='isContract']").eq(0).attr("checked",
                                "checked")
                            body.find('#isContract').css("display", "block")
                        } else if (data.isContract == "2") {
                            body.find("input[name='isContract']").eq(1).attr("checked",
                                "checked")
                        }

                        body.find("#tel").val(data.tel);
                        body.find("#otherTel").val(data.otherTel);
                        body.find("#email").val(data.email);
                        body.find("#graduateSchool").val(data.graduateSchool);
                        body.find("#major").val(data.major);
                        body.find("#heightEducation").val(data.heightEducation);
                        body.find("#aParty").val(data.aParty);
                        body.find("#bParty").val(data.bParty);
                        body.find("#contractTime").val(data.contractTime);
                        if (data.userContractImgList.length > 0) {
                            for (var i = 0; i < data.userContractImgList.length; i++) {
                                body.find('#imgRongqi').append(
                                    "<div class=\"layui-col-md24\"><div style=\"position:relative;width: 118px;height: 138px; margin-bottom: 10px;border: 1px solid #ccc;\"><i style=\"position:absolute\" class=\"layui-icon layui-icon-close\"></i><img class=\"updateHetong\" style=\"width: 100%;height: 100%;\" src=\"" +
                                    data.userContractImgList[i].imgUrl + "\"" +
                                    "alt=\"\"><\/div><\/div>"
                                )
                            }
                        }
                        body.find("#medicalReportDate").val(data.medicalReportDate);
                        // if (data.bankList.length > 0) {
                        //     if (data.bankList[0].bankCardNumA) {
                        //         body.find("#bankCardNumA").val(data.bankList[0]
                        //             .bankCardNumA);
                        //         body.find("#openingBankA").val(data.bankList[0]
                        //             .openingBankA);
                        //     }
                        //     if (data.bankList[0].bankCardNumB) {
                        //         body.find("#bankCardNumB").val(data.bankList[0]
                        //             .bankCardNumB);
                        //         body.find("#openingBankB").val(data.bankList[0]
                        //             .openingBankB);
                        //     }
                        //     if (data.bankList[0].bankCardNumC) {
                        //         body.find("#bankCardNumC").val(data.bankList[0]
                        //             .bankCardNumC);
                        //         body.find("#openingBankC").val(data.bankList[0]
                        //             .openingBankC);
                        //     }
                        // }
                        body.find("#city").attr("data-val", data.city);

                        iframeWin.frames.layui.form.render("select");
                        iframeWin.frames.layui.form.render("radio");
                        body.find("#updateTijian").attr("src", data.medicalReportUrl);
                        body.find("#updateHeadImg").attr("src", data.headPhoto);
                        // body.find('#refereeClothingSize').text(data.refereeClothingSize);
                        // body.find('#otherClothingSize').text(data.otherClothingSize);
                        // body.find('#soccerShoesSize').text(data.soccerShoesSize);
                        // body.find('#runningShoesSize').text(data.runningShoesSize);
                    }
                })
            }
            if (layEvent === "watch") {
                // layer.msg('审批');
                layer.open({
                    content: "look_trainer_info.html",
                    type: 2, //打开的窗口的类型
                    area: ["100%", "100%"],
                    title: "查看信息",
                    // btn: ['确认', '取消'],//开启显示按钮功能
                    // btnAlign: 'c',//居中显示按钮
                    // shade:true,
                    shadeClose: true,
                    success: function (layero, index) {

                        // console.log(data)//获取点击行的数据,获取打开的iframe
                        var body = layer.getChildFrame('body', index);
                        var iframeWin = window[layero.find('iframe')[0]['name']];
                        console.log(data)
                        if (data.bloodType == "1") {
                            body.find('#bloodType').text("A");
                        } else if (data.bloodType == "2") {
                            body.find('#bloodType').text("B");
                        } else if (data.bloodType == "3") {
                            body.find('#bloodType').text("AB");
                        } else if (data.bloodType == "4") {
                            body.find('#bloodType').text("O");
                        }
                        if (data.documentType == "1") {
                            body.find('#documentType').text("身份证");
                        } else if (data.documentType == "2") {
                            body.find('#documentType').text("护照");
                        } else if (data.documentType == "3") {
                            body.find('#documentType').text("户口本");
                        }
                        if (data.sex == "1") {
                            body.find('#sex').text("男");
                        } else if (data.sex == "2") {
                            body.find('#sex').text("女");
                        }
                        if (data.politicCountenance == "1") {
                            body.find('#politicCountenance').text("党员");
                        } else if (data.politicCountenance == "2") {
                            body.find('#politicCountenance').text("共青团员");
                        } else if (data.politicCountenance == "3") {
                            body.find('#politicCountenance').text("群众");
                        }
                        if (data.coachLevel == "1") {
                            body.find('#coachLevel').text("D级")
                        } else if (data.coachLevel == "2") {
                            body.find('#coachLevel').text("C级")
                        } else if (data.coachLevel == "3") {
                            body.find('#coachLevel').text("B级")
                        } else if (data.coachLevel == "4") {
                            body.find('#coachLevel').text("A级")
                        } else if (data.coachLevel == "5") {
                            body.find('#coachLevel').text("职业级（PRO）")
                        }
                        if (data.isContract == "1") {
                            body.find('#isContract').text("有")
                        } else if (data.isContract == "2") {
                            body.find('#isContract').text("无")
                        }
                        body.find('#id').text(data.id);
                        body.find("#name").text(data.name);
                        body.find("#documentNumber").text(data.documentNumber);
                        body.find("#height").text(data.height);
                        body.find("#weight").text(data.weight);
                        body.find("#nationality").text(data.nationality);
                        body.find("#nation").text(data.nation);
                        body.find("#associationId").text(data.associationName);
                        body.find("#year").text(data.year);
                        body.find("#birthDay").text(data.birthDay);
                        body.find("#birthAddress").text(data.birthAddress);
                        body.find("#tel").text(data.tel);
                        body.find("#otherTel").text(data.otherTel);
                        body.find("#email").text(data.email);
                        body.find("#graduateSchool").text(data.graduateSchool);
                        body.find("#major").text(data.major);
                        body.find("#heightEducation").text(data.heightEducation);
                        body.find("#aParty").text(data.aParty);
                        body.find("#bParty").text(data.bParty);
                        body.find("#contractTime").text(data.contractTime);
                        if (data.userContractImgList.length > 0) {
                            for (var i = 0; i < data.userContractImgList.length; i++) {
                                body.find('#imgRongqi').append(
                                    "<div class=\"layui-col-md24\"><div style=\"position:relative;width: 118px;height: 138px; margin-bottom: 10px;border: 1px solid #ccc;\"><img class=\"updateHetong\" style=\"width: 100%;height: 100%;\" src=\"" +
                                    data.userContractImgList[i].imgUrl + "\"" +
                                    "alt=\"\"><\/div><\/div>")
                            }
                        }
                        body.find("#refereeClothingSize").text(data.refereeClothingSize);
                        body.find("#otherClothingSize").text(data.otherClothingSize);
                        body.find("#soccerShoesSize").text(data.soccerShoesSize);
                        body.find("#runningShoesSize").text(data.runningShoesSize);
                        body.find("#medicalReportDate").text(data.medicalReportDate);
                        // if (data.bankList.length > 0) {
                        //     if (data.bankList[0].bankCardNumA) {
                        //         body.find("#bankCardNumA").text(data.bankList[0]
                        //             .bankCardNumA);
                        //         body.find("#openingBankA").text(data.bankList[0]
                        //             .openingBankA);
                        //     }
                        //     if (data.bankList[0].bankCardNumB) {
                        //         body.find("#bankCardNumB").text(data.bankList[0]
                        //             .bankCardNumB);
                        //         body.find("#openingBankB").text(data.bankList[0]
                        //             .openingBankB);
                        //     }
                        //     if (data.bankList[0].bankCardNumC) {
                        //         body.find("#bankCardNumC").text(data.bankList[0]
                        //             .bankCardNumC);
                        //         body.find("#openingBankC").text(data.bankList[0]
                        //             .openingBankC);
                        //     }
                        // }
                        body.find("#city").text(data.city);
                        body.find("#medicalReportUrl").attr("src", data.medicalReportUrl);
                        body.find("#headPhoto").attr("src", data.headPhoto);
                        // body.find('#refereeClothingSize').text(data.refereeClothingSize);
                        // body.find('#otherClothingSize').text(data.otherClothingSize);
                        // body.find('#soccerShoesSize').text(data.soccerShoesSize);
                        // body.find('#runningShoesSize').text(data.runningShoesSize);
                    }
                })
            };
            if (layEvent === 'del') {

                layer.confirm('确认锁定？', function (index) {
                    layer.close(index);

                    $.ajax({ //保存表单
                        url: delTrainerList,
                        type: "POST",
                        // 设置的是请求参数
                        data: {
                            id: data.id
                        },
                        // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
                        dataType: 'json',
                        success: function (res) {
                            if (res.msg !== "0") {
                                layer.alert(res.msg, {
                                    title: "提示"
                                });
                            } else {
                                layer.alert("操作成功", {
                                    title: "提示",
                                    cancel: function (index) {
                                        layer.close(index);
                                        obj.del();
                                    }
                                }, function (index) {
                                    layer.close(index);
                                    obj.del();
                                });
                            }
                        }
                    })

                });
            }
        });


    });

    function show_img(t) { //放大图片
        var t = $(t).find("img");
        //页面层
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['300px', '343px'], //宽高
            shadeClose: true, //开启遮罩关闭
            end: function (index, layero) {
                return false;
            },
            content: '<div style="text-align:center;width:100%;height: 100%;overflow: hidden"><img src="' + $(t)
                .attr('src') + '" style="width:100%;height: 100%;display: block;margin: 0 auto;"/></div>'
        });
    }
</script>